package com.woniuxy.exception;

import com.woniuxy.util.ResponseData;
import com.woniuxy.util.ResponseEnum;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @BelongsProject: pigTrotterStore
 * @BelongsPackage: com.woniuxy.exception
 * @Author: Quan
 * @Date: 2025/3/10 19:01
 */
//@ControllerAdvice
public class GlobalException {

	/**
	 * @Description: 异常切点
	 * @Param: e - [Exception]
	 * @Author: Quan
	 * @Date: 2025/3/10
	*/
	@ExceptionHandler(Exception.class)
	@ResponseBody
	public ResponseData<?> handleException(Exception e) {
		return ResponseData.fail(ResponseEnum.FAIL);
	}
}
